<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>layui</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="../css/layui.css" media="all">
		<!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->

	</head>

	<body>
		<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
		<!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

		<div class="layui-container">

			<div class="layui-row" id="app">

				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
					<legend>异常信息</legend>

				</fieldset>

				<div class="layui-form" style="margin-top: 65px;">
					<table id="demo" class="layui-table" style="text-align: center;"></table>
					<!--<table class="layui-table" style="text-align: center;">
						<colgroup>
							<col width="150">
							<col width="150">
							<col width="200">
							<col>
						</colgroup>
						<thead>
							<tr>
								<th style="text-align: center;">课程名称</th>
								<th style="text-align: center;">实验名称</th>
								<th style="text-align: center;">实验时间</th>
								<th style="text-align: center;">备注</th>
							</tr>
						</thead>
						<tbody>
							<tr v-for="item of msglist">
								<td>{{item.couName}}</td>
								<td>{{item.expName}}</td>
								<td>{{item.proTime}}</td>
								<td>{{item.content}}</td>
							</tr>

						</tbody>
					</table>-->
				</div>

				<div class="layui-col-md-offset2" style="margin-top: 50px;">
					<!--
	作者：offline
	时间：2018-08-27
	描述：分页div demo7
-->
					<table id="demo"></table>
				</div>

			</div>

		</div>

		<script src="../layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="../js/vue.min.js"></script>
		<script type="text/javascript" src="../js/jquery.min.js"></script>
		<script type="text/javascript" src="../js/jquery.cookie.js"></script>
		<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
		<script>
			
			$.ajax({
					url:"http://localhost:8080/student/nodo.do",
					async:"get",
					dataType:"json",
					data:{
						sid:$.cookie("sid")
					},
					success:function(data){
						if(data.info == "404"){
							window.location.href="stulogin.html";
						}
					}
					
				})
			
			$(function() {

				$(document).bind("contextmenu", function(e) {
					return false;
				});

				layui.use('table', function() {
					var table = layui.table;
					//完整功能
					table.render({
						elem: '#demo',
						height: 315,
						url: 'http://127.0.0.1:8080/student/warn/list.do',
						where: {
							sid: $.cookie("sid")
						},
						page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
							layout: ['count', 'prev', 'page', 'next'] //自定义分页布局
								//,curr: 5 //设定初始在第 5 页
								,
							groups: 5 //只显示 5 个连续页码
								,
							first: true //显示首页
								,
							last: true //显示尾页
								,
							limit: 6
						},
						/*page: true,*/
						cols: [
							[ //表头 
								{
									field: 'couName',
									title: '课程名称',
									fixed: 'left'
								}, {
									field: 'expName',
									title: '实验名称'
								}, {
									field: 'proTime',
									title: '实验时间',
									sort: true
								}, {
									field: 'content',
									title: '备注',
								}
							]
						]
					});

				});
			})

			/*	var list;
				$.ajax({
					type: "get",
					dataType: "json",
					url: "http://127.0.0.1:8080/student/warn/list.do",
					async: false,
					success: function(data) {
						list = data;
					}
				});*/

			var point;
			$.ajax({
				xhrFields: {
					withCredentials: true
				},
				type: "get",
				dataType: "json",
				url: "http://127.0.0.1:8080/student/warn/warnpoint.do",
				async: false,
				data: {
					sid: $.cookie("sid")
				},
				success: function(data) {
					point = data;
				}
			});

			var vue = new Vue({
				el: "#app",
				data: {
					/*msglist: list,*/
					point: point
				},
				methods: {

				}

			});
		</script>

	</body>

</html>